package communication;

import java.io.Serializable;
import Ships.Ship;

public class GameMessage implements Serializable{

	/**
	 * 
	 */
	
	public final static int GAME_START = 401;
	public final static int GAME_MSG_RECEIVED = 403;
	public final static int GAME_MY_MOVE_RES = 404;
	public final static int GAME_ENEMY_MOVE = 405;
	public final static int GAME_DISCONNECTED = 406;
	public final static int GAME_OVER = 407;
	public final static int GAME_WIN = 408;
	public final static int GAME_QUIT = 409;
	public final static int GAME_CONFIG_OK = 410;
	public static final int GAME_ENEMY_CONFIGURED = 411;
	
	private static final long serialVersionUID = 2670170695863310530L;
	
	
	private String msg;
	private int type;
	private int line;
	private int column;
	private boolean onShip;
	private boolean shipDestroyed;
	private boolean firstToPlay;

	private Ship ship;
	
	public GameMessage(int type) {
		this.msg="";
		this.type = type;
		line = -1;
		column = -1;
		onShip = false;
		shipDestroyed = false;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getLine() {
		return line;
	}

	public void setLine(int line) {
		this.line = line;
	}

	public int getColumn() {
		return column;
	}

	public void setColumn(int column) {
		this.column = column;
	}

	public boolean isOnShip() {
		return onShip;
	}

	public void setOnShip(boolean onShip) {
		this.onShip = onShip;
	}

	public boolean isShipDestroyed() {
		return shipDestroyed;
	}

	public void setShipDestroyed(boolean shipDestroyed) {
		this.shipDestroyed = shipDestroyed;
	}

	public Ship getShip() {
		return ship;
	}
	
	public void setShip(Ship ship) {
		this.ship = ship;
	}
	
	public boolean isFirstToPlay() {
		return firstToPlay;
	}
	
	public void setFirstToPlay(boolean firstToPlay) {
		this.firstToPlay = firstToPlay;
	}
	
	
}
